package com.w.mq;

public class TestConsumer {
    public static void main(String[] args) {
        Consumer Consumer = new Consumer();
        Consumer.init();
        TestConsumer testConsumer = new TestConsumer();
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        new Thread(testConsumer.new ConsumerMq(Consumer)).start();
        new Thread(testConsumer.new ConsumerMq(Consumer)).start();
        new Thread(testConsumer.new ConsumerMq(Consumer)).start();
        new Thread(testConsumer.new ConsumerMq(Consumer)).start();
        new Thread(testConsumer.new ConsumerMq(Consumer)).start();
    }

    private class ConsumerMq implements Runnable {
        Consumer Consumer;

        public ConsumerMq(Consumer Consumer) {
            this.Consumer = Consumer;
        }

        @Override
        public void run() {
            while (true) {
                Consumer.getMessage("Jaycekon-MQ");
//                    Thread.sleep(10000);
            }
        }
    }
}